﻿<UserControl x:Class="Gao.Poker.App.Game.GameMain"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:UserControls="clr-namespace:Gao.Poker.App.UserControls" mc:Ignorable="d">
    <Grid Margin="0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*"/>
            <ColumnDefinition Width="7*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BorderBrush="{x:Null}" BorderThickness="0,1" Margin="3">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#A1C7CFDA" Offset="0.991"/>
                    <GradientStop Color="#B5F1F1F1"/>
                    <GradientStop Color="#FFD2D2D2" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <StackPanel Margin="0" Orientation="Horizontal" VerticalAlignment="Center">
                <Button Content="开始比赛" VerticalContentAlignment="Center" FontSize="16" Click="Start_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="新增" VerticalContentAlignment="Center" FontSize="16" Click="New_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="修改" VerticalContentAlignment="Center" FontSize="16" Click="Modifiy_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="报名" VerticalContentAlignment="Center" FontSize="16" Click="Apply_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="买入" VerticalContentAlignment="Center" FontSize="16" Click="BuyStake_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
                <Button Content="比赛结束" VerticalContentAlignment="Center" FontSize="16" Click="End_Click" Style="{DynamicResource Blue}" Width="80"/>
                <Border BorderBrush="#CCFFFFFF" BorderThickness="1,0,0,0" HorizontalAlignment="Left"  Width="2.5" Background="#FFB6B6B6"/>
            </StackPanel>
        </Border>

        <Grid Grid.Column="0" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal" Margin="5">
                <TextBlock Text="比赛名称：" Margin="10,5,0,5"  VerticalAlignment="Center"/>
                <TextBox Text="{Binding CompetitionName}" Width="150" Margin="0,5,0,5"/>
                <Button x:Name="btnSearch" Margin="10,5,5,5" Width="45" Style="{DynamicResource Orrange}" Content="查询" />
            </StackPanel>
            <DataGrid Grid.Row="1" Margin="1,1,1.2,1" VerticalAlignment="Top" RowHeight="30" AutoGenerateColumns="False" IsReadOnly="True"
                      SelectionMode="Single"  CanUserAddRows="True" CanUserResizeColumns="False" CanUserResizeRows="False"
                      ItemsSource="{Binding Path=AllCompetitions}" SelectedItem="{Binding Path=Competition}" 
                      FontSize="16" Height="600" SelectionChanged="DataGrid_SelectionChanged" Name="dgCompetition" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="比赛名称" Width="*" Binding="{Binding Path=Name}"/>
                    <DataGridTextColumn Header="比赛时间" Width="90" Binding="{Binding Path=Date, StringFormat='yyyy-MM-dd'}"/>
                    <DataGridTextColumn Header="状态" Width="60" Binding="{Binding Path=State, Converter={StaticResource GenericTypeConverter}, ConverterParameter='Alias=0:正常|1:结束'}"/>
                </DataGrid.Columns>
            </DataGrid>
            <UserControls:Pager Grid.Row="2" Count="{Binding Path=AllCompetitionTotal}" PageIndexChanging="Pager_PageIndexChanging" />
        </Grid>
        <ContentControl Grid.Column="1" Grid.Row="1" Name="cc"/>
    </Grid>
</UserControl>
